package ua.kpi_java_training.zabrodskyi.module3;

import static org.junit.Assert.*;

import org.junit.Test;

/**
 * @author Maksym Zabrodskyi
 * @version 24-Jun-2013
 */
public class RandomTest {

	@Test
	public void shouldGetGoodRandomCell() {
		Cell cell = Random.getCell();
		assertNotNull(cell);
		assertFalse(cell.isBad());
	}

	@Test
	public void shouldGetRandomValueOfStep() {
		int valueOfMaxStep = 5;
		int randomValueOfStep = Random.getStep(valueOfMaxStep);
		assertTrue(randomValueOfStep > 0);
		assertTrue(randomValueOfStep <= valueOfMaxStep);
	}

	@Test
	public void shouldGetRandomDirection() {
		Direction randomDirection = Random.getDirection();
		assertNotNull(randomDirection);
		boolean isDirectionCorrect = randomDirection.equals(Direction.EAST)
				|| randomDirection.equals(Direction.WEST)
				|| randomDirection.equals(Direction.NORTH_EAST)
				|| randomDirection.equals(Direction.NORTH_WEST)
				|| randomDirection.equals(Direction.SOUTH_EAST)
				|| randomDirection.equals(Direction.SOUTH_WEST);
		assertTrue(isDirectionCorrect);
	}

}
